
#include "size.h"

unsigned int power (int base, int exp)
{
	unsigned int answer = 1;
	for (int i=1; i<=exp; i++)
	{
		answer *= base;
	}
	return answer;
}

unsigned int NumObjs (int c, int i)
{
	int objs = 0;
	switch (c)
	{
	case 0:	objs = 4; break;	/* Tetrahedron */
	case 1: objs = 6; break;	/* Octahedron */
	case 2: objs = 8; break;	/* Cube */
	case 3: objs = 12; break;	/* Icosahedron */
	case 4: objs = 20; break;	/* Dodecahedron */
	}
	return (power(objs,i));
}

unsigned int NumFaces (int c, int i)
{
	int faces = 0;
	switch (c)
	{
	case 0: faces = 4; break;	/* Tetrahedron */
	case 1: faces = 8; break;	/* Octahedron */
	case 2: faces = 6; break;	/* Cube */
	case 3: faces = 20; break;	/* Icosahedron */
	case 4: faces = 12; break;	/* Dodecahedron */
	}
	return faces * NumObjs (c, i);
}

unsigned int NumPoints (int c, int i)
{
	int points = 0;
	switch (c)
	{
	case 0: points = 3; break;	/* Tetrahedron */
	case 1: points = 3; break;	/* Octahedron */
	case 2: points = 4; break;	/* Cube */
	case 3: points = 3; break;	/* Icosahedron */
	case 4: points = 5; break;	/* Dodecahedron */
	}
	return points * NumFaces (c, i);
}